<%@page import="bean.B01scoreVO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="bean.B01scoreDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href ='/Web/02CSS/B01score.css'>
<script src = '/Web/03JavaScript/B01score.js'></script>
</head>
<body>
<jsp:useBean id="vo" class="bean.B01scoreVO" scope="page"/>
<jsp:setProperty property="*" name="vo"/>
<%
	B01scoreDTO dto = new B01scoreDTO();
	dto.setVo(vo);
	ArrayList<B01scoreVO> al = dto.select();

%>
<h1> 성적회원목록 </h1>
	<hr>
	<form name = 'hiddenFrm' method='post'>
	 	<input type='hidden' name="nowPage">
	 	<input type='hidden' name='find'>
	 	<input type='hidden' name='rno'>
	</form>
	
	<div>
		<form action="index.jsp?inc=/04JSP/01Score/list.jsp" name ='score_list_frm' method = 'post'>
			<input type="text" name = 'find' value ="<%=vo.getFind() %>"/>
			<input type="submit" value='검색'>
		</form>
	</div>
	<p/>
	<div id = 'score_list_title'>
		<div class='score_list_rno'>순번</div>
		<div class='score_list_mid'>아이디</div>
		<div class='score_list_grade'>학년</div>
		<div class='score_list_exam'>시험종류</div>
		<div class='score_list_point'>성적</div>	
	</div>
<%for(int a=0; a<al.size(); a++){ 
	B01scoreVO v = al.get(a);
%>
 <div class="score_list_items">
<%-- 		<div class='score_list_rno'><%=v.getRno() %></div> <!-- 실제 넘어가는 값  --> 
			<div class='score_list_mid'><%=v.getMid() %></div> <!-- 실제 클릭되는 값   -->--%>
		<div class='score_list_rno'><%=v.getRno() %></div>
		<div class='score_list_mid'> <!-- 실제 클릭되는 값   -->
			<a href = '#' onclick="goView(<%=dto.getNowPage()%>,<%=v.getRno()%>)"><%=v.getMid()%></a>
		</div>	
		<div class='score_list_grade'><%=v.getGrade()%></div>
		<div class='score_list_exam'><%=v.getExam() %></div>
		<div class='score_list_point'><%=v.getPoint() %></div>
	</div>	
<%}%>	

<div id = 'list_page' align="center">
<% if(dto.getNowPage()==1){%>
	[처음으로]
	<%}else{%><a href='#' onclick='goPage(1)'>[처음으로]  </a>
	<%}%>
	
<% if(dto.getNowBlock()==1){%>
	[이전으로]
	<%}else{%><a href="#" onclick='goPage(<%=dto.getStartPage()-1 %>)'>[이전으로]</a>
	<%} %>	
<%
int i=0;
for(i = dto.getStartPage(); i<=dto.getEndPage(); i++){%>
	<%-- <a href= "index.jsp?inc=/04JSP/01Score/list.jsp&nowPage=<%=i %>&find=<%=vo.getFind()%>"><%= i %></a> --%>
	<a href= "#" onclick = "goPage(<%= i %>)"><%= i %></a>
<%} %>
<% if(dto.getNowBlock()==dto.getTotBlock()){%>
	[다음으로]
	<%}else{%><a href= '#' onclick = "goPage(<%=i %>)">  [다음으로]</a>
	<%} %>
	
<% if(dto.getNowPage()==dto.getTotPage()){%>
	[맨끝으로]
	<%}else{%><a href= "#" onclick = "goPage(<%=dto.getTotPage() %>)">  [맨끝으로]</a>
	<%} %>	
	
</div>


<!-- 페이징 테스트   -->
<!-- <a href= "index.jsp?inc=/04JSP/01Score/list.jsp&nowPage=1">1</a>
<a href= "index.jsp?inc=/04JSP/01Score/list.jsp&nowPage=2">2</a>
<a href= "index.jsp?inc=/04JSP/01Score/list.jsp&nowPage=3">3</a>
<a href= "index.jsp?inc=/04JSP/01Score/list.jsp&nowPage=4">4</a> -->

<!-- 성적 검색 테스트  -->
<!-- <a href="index.jsp?inc=/04JSP/01Score/search.jsp"> 성적 검색</a> -->

<!-- 각 글넘버에 따른 view 테스트  -->
<!-- 	<br>
		<ul>
		<li><a href = '#' onclick ='goPage(1)'>성적목록1</a>
		<li><a href = '#' onclick ='goPage(2)'>성적목록2</a>
		<li><a href = '#' onclick ='goPage(3)'>성적목록3</a>
		<li><a href = '#' onclick ='goPage(4)'>성적목록4</a>
		</ul> -->
	<hr>
		<input type="button" value="성적입력" id="btnInput"/>

</body>
<script>listInit();</script>
</html>